package deftoolbar

import "yunj/pkg/yunj/core/builder/builderaction"

// 筛选列
type Filter struct {
	Action
}

func NewFilter(title ...string) *Filter {
	a := &Filter{}

	builderaction.SetActionInstance(&a.Action.Action, a)
	a.SetActionCode("filter")
	if len(title) > 0 {
		a.SetTitle(title[0])
	}
	return a
}

// 设置标题
func (a *Filter) SetTitle(title string) *Filter {
	a.Title = title
	return a
}

// 设置权限
func (a *Filter) SetAuth(auth string) *Filter {
	a.Auth = auth
	return a
}
